<template>
	<view class="order" @click="goDetail(order._id)">
		<view class="order-cus">
			<view class="address">
				<text class="cuIcon-locationfill text-gray"></text>
				<text>{{order.address.detail}}</text>
			</view>
			<view class="phone">
				<text>{{order.receiveUser.phone}}</text>
				<text class="cuIcon-phone text-gray"></text>
			</view>	
		</view>
		<view class="goods-info">
			<view class="goods-list">
				<view class="goods-item" v-for="(item, index) in order.detail" :key="index" v-if="index < 3">
					<image class="goods-img" :src="baseUrl + item.thumbnail"></image>
					<text class="goods-title">{{item.goodsName}}</text>
				</view>
			</view>
			<view class="other-info">
				<view class="price-count">
					<text>共{{order.detail.length}}件</text>
					<text>共{{order.discountPrice}}元</text>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import config from '@/config.js';
	export default{
		name: 'order-await',
		props:{
			order: Object
		},
		data() {
			return {
				baseUrl: config.network.imageUrl
			}
		},
		methods: {
			goDetail(id) {
				uni.navigateTo({
					url: `/pages/order/orderDetail?id=${id}`
				})
			}
		}
	}
</script>

<style scoped lang="less">
	@import "./index.less";
</style>
